package chixing.day13.work;

public class CupTest {
    public static void main(String[] args) {
            // 创建几个Cup对象用于测试比较
            Cup cup1 = new Cup(1, "Mug", 29.9, "China", "White", 350);
            Cup cup2 = new Cup(2, "Mug", 29.9, "Japan", "Black", 400);
            Cup cup3 = new Cup(3, "Mug", 39.9, "Korea", "Blue", 350);
            Cup cup4 = new Cup(4, "Cup", 19.9, "China", "Red", 250);
            Cup cup5 = new Cup(1, "Mug", 29.9, "China", "Green", 350); // 与cup1编号、名称、价格相同

            // 测试比较结果
            System.out.println("cup1与cup2比较: " + cup1.compare(cup2));  // 比较编号，cup1.id < cup2.id，返回-1
            System.out.println("cup2与cup1比较: " + cup2.compare(cup1));  // 比较编号，cup2.id > cup1.id，返回1
            System.out.println("cup1与cup3比较: " + cup1.compare(cup3));  // 比较价格，cup1.price < cup3.price，返回-1
            System.out.println("cup1与cup4比较: " + cup1.compare(cup4));  // 比较名称，"Mug" > "Cup"，返回正整数
            System.out.println("cup1与cup5比较: " + cup1.compare(cup5));  // 所有条件相同，返回0
        }
}
